//
//  LabelView.m
//  MorePlatformCeShiApp
//
//  Created by dsy123 on 2021/8/10.
//

#import "LabelView.h"

@interface LabelView ()

@property (nonatomic,retain) UILabel *nameLabel;

@property (nonatomic,retain) UIButton *button;

@end

@implementation LabelView

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.nameLabel = [[UILabel alloc] init];
        
        _nameLabel.text = @"很骄傲的数据库的时间啊";
        _nameLabel.backgroundColor = [UIColor redColor];
        [self addSubview:_nameLabel];
        
        self.button = [UIButton buttonWithType:(UIButtonTypeSystem)];
        [self.button setTitle:@"点击事件" forState:(UIControlStateNormal)];
        self.button.backgroundColor = [UIColor blueColor];
        [self.button addTarget:self action:@selector(didClickedButton) forControlEvents:(UIControlEventTouchUpInside)];
        [self addSubview:self.button];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.nameLabel.frame = CGRectMake(0, 0, 150, self.bounds.size.height - 20);
    self.button.frame = CGRectMake(0, self.bounds.size.height - 20, 150, 20);
}

- (void)didClickedButton {
    
}

@end
